package Day07.Zuoye;

public class TestAnimal {
    public static void main(String[] args) {
        Dog xiaoyu=new Dog();
        Cat miao=new Cat();
        xiaoyu.eat("黑色","藏獒");
        xiaoyu.lookHome("黑色","藏獒");
        miao.eat("花色","波斯猫");
        miao.catchMouse("花色","波斯猫");

        Dog xiao=new Dog("金色","金毛");
        Cat halo =new Cat("粉色","hollkitty");
        xiao.show();
        halo.show();// 2. 通过带参数构造方法, 直接给属性进行赋值


        xiaoyu.setBreed("拉布拉多");
        xiaoyu.setColor("白色");
        miao.setBreed("破坏神");
        miao.setColor("紫色");
        miao.show();
        xiaoyu.show(); // 1. 无参数构造方法创建对象, 通过setXxx方法给成员变量进行赋值
    }
}
